﻿using System;

class Timerout0VO : TimeroutBaseVO
{
    private Action fun;

    public Timerout0VO(Action fun, float delay)
    {
        this.delay = delay;
        this.fun = fun;
    }

    public override void Destroy()
    {
        fun = null;
    }

    protected override void CallFun()
    {
        fun();
    }
}

class Timerout1VO<Arg> : TimeroutBaseVO
{
    private Action<Arg> fun;
    private Arg arg;

    public Timerout1VO(Action<Arg> fun, float delay, Arg arg)
    {
        this.delay = delay;
        this.fun = fun;
        this.arg = arg;
    }

    public override void Destroy()
    {
        fun = null;
    }

    protected override void CallFun()
    {
        fun(arg);
    }
}

class Timerout2VO<Arg1, Arg2> : TimeroutBaseVO
{
    private Action<Arg1, Arg2> fun;
    private Arg1 arg1;
    private Arg2 arg2;

    public Timerout2VO(Action<Arg1, Arg2> fun, float delay, Arg1 arg1, Arg2 arg2)
    {
        this.delay = delay;
        this.fun = fun;
        this.arg1 = arg1;
        this.arg2 = arg2;
    }

    public override void Destroy()
    {
        fun = null;
    }

    protected override void CallFun()
    {
        fun(arg1, arg2);
    }
}